<template>
  <!--登录表单的容器-->
  <div class="login_container">
    <!--登录区域-->
    <div class="login_box">
      <!--头像-->
      <div class="avatar_box">
        <img src="../../assets/imgs/tx.jpg" />
      </div>
      <!-- 表单 -->
      <el-form ref="form" :model="form" label-width="0px" class="el-from">
        <el-form-item prop="username">
          <el-input
            v-model="form.username"
            placeholder="请输入用户名称"
            prefix-icon="el-icon-user-solid"
          ></el-input>
        </el-form-item>
        <el-form-item prop="password">
          <el-input
            v-model="form.password"
            placeholder="请输入用户密码"
            prefix-icon="el-icon-lock"
          ></el-input>
        </el-form-item>
        <!-- 验证码 -->
        <el-form-item prop="verifyCode">
          <div class="verifyCode_box">
            <el-input
              v-model="form.verifyCode"
              placeholder="请输入手机验证码"
              prefix-icon="el-icon-mobile"
              class="verifyCode"
            ></el-input>
            <img
              src="../../assets/imgs/yzm.png"
              alt=""
              class="verifyCode_img"
            />
          </div>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">登陆</el-button>
          <el-button>重置</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        username: "yyq",
        password: "123456",
        verifyCode: "",
      },
    };
  },
  methods: {
    onSubmit() {
      this.$router.push("/home");
    },
  },
};
</script>

<style lang="less" scoped>
.login_container {
  height: 100vh;
  background-color: rgb(243, 183, 232);
  border: 1px solid black;
  display: flex;
  //上下居中
  align-items: center;
  //测轴剧中
  justify-content: center;
  .login_box {
    width: 450px;
    height: 380px;
    background-color: #f1f0a5;
    //父相
    position: relative;
    padding: 20px;
    .avatar_box {
      width: 130px;
      height: 130px;
      background-color: #ffffff;
      border-radius: 50%;
      padding: 10px;
      //子绝
      position: absolute;
      top: -75px;
      right: 170px;
      img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
      }
    }
    .el-from {
      padding-top: 75px;
      .verifyCode_box {
        display: flex;

        .verifyCode {
          flex: 2;
        }

        .verifyCode_img {
          flex: 1;
        }
      }
    }
  }
}
.el-input {
  margin-bottom: 20px;
}
</style>